package com.sgcc.ln.pmos.common.base;


import com.sgcc.ln.pmos.common.utils.AssertUtils;

/**
 * <pre>
 * 文件名：	BasePresenter
 * 作　者：	jqli
 * 时　间：	2018/3/13 11:34
 * 描　述：
 * @author
 * </pre>
 */
public class BasePresenter<V extends IView> implements IPresenter<V> {
    private V mView;

    public BasePresenter() {
    }

    public boolean isViewAttached() {
        return mView != null;
    }

    public V getView() {
        return mView;
    }


    @Override
    public void attachView(V view) {
        this.mView = view;
        AssertUtils.checkNull(mView);
    }

    @Override
    public void detachView() {
        if (mView != null) {
            this.mView = null;
        }
    }

}